package com.bjsxt.thread;

public class GetThreadName {
    public static void main(String[] args) {
        GetName1 t = new GetName1();
        Thread t2 = new Thread(new GetName2());
        t.start();
        t2.start();
    }
}


class GetName1 extends Thread{
    @Override
    public void run() {
        System.out.println(this.getName()+" Thread");
    }
}

class GetName2 implements Runnable{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+" Runnable");
    }
}